IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[cms_sp_MediaFileAdd]') AND type in (N'P', N'PC'))
	DROP PROCEDURE [dbo].[cms_sp_MediaFileAdd]
GO
create procedure [dbo].[cms_sp_MediaFileAdd]
(
@Id int = null output,
@SiteId int = null,
@SiteGroupId int = null,
@MimeTypeId int = null,
@OriginalFileName nvarchar(250),
@LinkedFileName nvarchar(250),
@FileSize int,
@Height int = null,
@Width int = null,
@CreatedBy int,
@DateCreated datetime,
@LastUpdatedBy int = null,
@DateLastUpdated datetime = null
)
as
insert into [dbo].[MediaFiles](
[SiteId],
[SiteGroupId],
[MimeTypeId],
[OriginalFileName],
[LinkedFileName],
[FileSize],
[Height],
[Width],
[CreatedBy],
[DateCreated]
)
values(
@SiteId,
@SiteGroupId,
@MimeTypeId,
@OriginalFileName,
@LinkedFileName,
@FileSize,
@Height,
@Width,
@CreatedBy,
@DateCreated
)
set @Id = SCOPE_IDENTITY()
return @Id


GO

